<?php

class CustomSiteConfig extends DataExtension {

    public static $db = array(
        'LinkFb' => 'Text',
        'LinkGoogle' => 'Text',
        'LinkTw' => 'Text',
        'LinkLinked' => 'Text',
        'LinkYoutube' => 'Text'
    );
    public static $has_one = array(
        'Logo' => 'Image'
    );

    public function updateCMSFields(FieldList $fields) {
        $fields->addFieldToTab('Root.Main', new UploadField('Logo', 'Logo(x)'));
        $fields->findOrMakeTab('Root.Socials','Socials');
        $fields->addFieldsToTab('Root.Socials',array(
            new TextField('LinkFb','URL Facebook(http://...)'),
            new TextField('LinkGoogle','URL Google+(http://...)'),
            new TextField('LinkTw', 'URL Twitter(http://...)'),
            new TextField('LinkLinked', 'URL Linked(http://...)'),
            new TextField('LinkYoutube', 'URL Youtube(http://...)')
        ));

//        $fields->findOrMakeTab('Root.Partner','Partner');
//        $partnerConfig = GridFieldConfig_RecordEditor::create()->addComponent(new GridFieldSortableRows('SortOrder'));
//        $partnerGridField = new GridField(
//            'Partner',
//            'Partner',
//            Partner::get(),
//            $partnerConfig
//        );
//        $fields->addFieldToTab('Root.Partner',$partnerGridField);
        return $fields;
    }

}
